Optimal. Leaf size=224 \[ -\frac {i (e+f x)^2}{a d}-\frac {2 (e+f x)^2 \tanh ^{-1}\left (e^{c+d x}\right )}{a d}+\frac {4 i f (e+f x) \log \left (1+i e^{c+d x}\right )}{a d^2}-\frac {2 f (e+f x) \text {PolyLog}\left (2,-e^{c+d x}\right )}{a d^2}+\frac {4 i f^2 \text {PolyLog}\left (2,-i e^{c+d x}\right )}{a d^3}+\frac {2 f (e+f x) \text {PolyLog}\left (2,e^{c+d x}\right )}{a d^2}+\frac {2 f^2 \text {PolyLog}\left (3,-e^{c+d x}\right )}{a d^3}-\frac {2 f^2 \text {PolyLog}\left (3,e^{c+d x}\right )}{a d^3}-\frac {i (e+f x)^2 \tanh \left (\frac {c}{2}+\frac {i \pi }{4}+\frac {d x}{2}\right )}{a d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.25, antiderivative size = 224, normalized size of antiderivative = 1.00, number of steps
used = 14, number of rules used = 11, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.379, Rules used = {5694, 4267,
2611, 2320, 6724, 3399, 4269, 3797, 2221, 2317, 2438} \begin {gather*} \frac {4 i f^2 \text {Li}_2\left (-i e^{c+d x}\right )}{a d^3}+\frac {2 f^2 \text {Li}_3\left (-e^{c+d x}\right )}{a d^3}-\frac {2 f^2 \text {Li}_3\left (e^{c+d x}\right )}{a d^3}-\frac {2 f (e+f x) \text {Li}_2\left (-e^{c+d x}\right )}{a d^2}+\frac {2 f (e+f x) \text {Li}_2\left (e^{c+d x}\right )}{a d^2}+\frac {4 i f (e+f x) \log \left (1+i e^{c+d x}\right )}{a d^2}-\frac {2 (e+f x)^2 \tanh ^{-1}\left (e^{c+d x}\right )}{a d}-\frac {i (e+f x)^2 \tanh \left (\frac {c}{2}+\frac {d x}{2}+\frac {i \pi }{4}\right )}{a d}-\frac {i (e+f x)^2}{a d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2221
Rule 2317
Rule 2320
Rule 2438
Rule 2611
Rule 3399
Rule 3797
Rule 4267
Rule 4269
Rule 5694
Rule 6724
Rubi steps
\begin {align*} \int \frac {(e+f x)^2 \text {csch}(c+d x)}{a+i a \sinh (c+d x)} \, dx &=-\left (i \int \frac {(e+f x)^2}{a+i a \sinh (c+d x)} \, dx\right )+\frac {\int (e+f x)^2 \text {csch}(c+d x) \, dx}{a}\\ &=-\frac {2 (e+f x)^2 \tanh ^{-1}\left (e^{c+d x}\right )}{a d}-\frac {i \int (e+f x)^2 \csc ^2\left (\frac {1}{2} \left (i c+\frac {\pi }{2}\right )+\frac {i d x}{2}\right ) \, dx}{2 a}-\frac {(2 f) \int (e+f x) \log \left (1-e^{c+d x}\right ) \, dx}{a d}+\frac {(2 f) \int (e+f x) \log \left (1+e^{c+d x}\right ) \, dx}{a d}\\ &=-\frac {2 (e+f x)^2 \tanh ^{-1}\left (e^{c+d x}\right )}{a d}-\frac {2 f (e+f x) \text {Li}_2\left (-e^{c+d x}\right )}{a d^2}+\frac {2 f (e+f x) \text {Li}_2\left (e^{c+d x}\right )}{a d^2}-\frac {i (e+f x)^2 \tanh \left (\frac {c}{2}+\frac {i \pi }{4}+\frac {d x}{2}\right )}{a d}+\frac {(2 i f) \int (e+f x) \coth \left (\frac {c}{2}-\frac {i \pi }{4}+\frac {d x}{2}\right ) \, dx}{a d}+\frac {\left (2 f^2\right ) \int \text {Li}_2\left (-e^{c+d x}\right ) \, dx}{a d^2}-\frac {\left (2 f^2\right ) \int \text {Li}_2\left (e^{c+d x}\right ) \, dx}{a d^2}\\ &=-\frac {i (e+f x)^2}{a d}-\frac {2 (e+f x)^2 \tanh ^{-1}\left (e^{c+d x}\right )}{a d}-\frac {2 f (e+f x) \text {Li}_2\left (-e^{c+d x}\right )}{a d^2}+\frac {2 f (e+f x) \text {Li}_2\left (e^{c+d x}\right )}{a d^2}-\frac {i (e+f x)^2 \tanh \left (\frac {c}{2}+\frac {i \pi }{4}+\frac {d x}{2}\right )}{a d}-\frac {(4 f) \int \frac {e^{2 \left (\frac {c}{2}+\frac {d x}{2}\right )} (e+f x)}{1+i e^{2 \left (\frac {c}{2}+\frac {d x}{2}\right )}} \, dx}{a d}+\frac {\left (2 f^2\right ) \text {Subst}\left (\int \frac {\text {Li}_2(-x)}{x} \, dx,x,e^{c+d x}\right )}{a d^3}-\frac {\left (2 f^2\right ) \text {Subst}\left (\int \frac {\text {Li}_2(x)}{x} \, dx,x,e^{c+d x}\right )}{a d^3}\\ &=-\frac {i (e+f x)^2}{a d}-\frac {2 (e+f x)^2 \tanh ^{-1}\left (e^{c+d x}\right )}{a d}+\frac {4 i f (e+f x) \log \left (1+i e^{c+d x}\right )}{a d^2}-\frac {2 f (e+f x) \text {Li}_2\left (-e^{c+d x}\right )}{a d^2}+\frac {2 f (e+f x) \text {Li}_2\left (e^{c+d x}\right )}{a d^2}+\frac {2 f^2 \text {Li}_3\left (-e^{c+d x}\right )}{a d^3}-\frac {2 f^2 \text {Li}_3\left (e^{c+d x}\right )}{a d^3}-\frac {i (e+f x)^2 \tanh \left (\frac {c}{2}+\frac {i \pi }{4}+\frac {d x}{2}\right )}{a d}-\frac {\left (4 i f^2\right ) \int \log \left (1+i e^{2 \left (\frac {c}{2}+\frac {d x}{2}\right )}\right ) \, dx}{a d^2}\\ &=-\frac {i (e+f x)^2}{a d}-\frac {2 (e+f x)^2 \tanh ^{-1}\left (e^{c+d x}\right )}{a d}+\frac {4 i f (e+f x) \log \left (1+i e^{c+d x}\right )}{a d^2}-\frac {2 f (e+f x) \text {Li}_2\left (-e^{c+d x}\right )}{a d^2}+\frac {2 f (e+f x) \text {Li}_2\left (e^{c+d x}\right )}{a d^2}+\frac {2 f^2 \text {Li}_3\left (-e^{c+d x}\right )}{a d^3}-\frac {2 f^2 \text {Li}_3\left (e^{c+d x}\right )}{a d^3}-\frac {i (e+f x)^2 \tanh \left (\frac {c}{2}+\frac {i \pi }{4}+\frac {d x}{2}\right )}{a d}-\frac {\left (4 i f^2\right ) \text {Subst}\left (\int \frac {\log (1+i x)}{x} \, dx,x,e^{2 \left (\frac {c}{2}+\frac {d x}{2}\right )}\right )}{a d^3}\\ &=-\frac {i (e+f x)^2}{a d}-\frac {2 (e+f x)^2 \tanh ^{-1}\left (e^{c+d x}\right )}{a d}+\frac {4 i f (e+f x) \log \left (1+i e^{c+d x}\right )}{a d^2}-\frac {2 f (e+f x) \text {Li}_2\left (-e^{c+d x}\right )}{a d^2}+\frac {4 i f^2 \text {Li}_2\left (-i e^{c+d x}\right )}{a d^3}+\frac {2 f (e+f x) \text {Li}_2\left (e^{c+d x}\right )}{a d^2}+\frac {2 f^2 \text {Li}_3\left (-e^{c+d x}\right )}{a d^3}-\frac {2 f^2 \text {Li}_3\left (e^{c+d x}\right )}{a d^3}-\frac {i (e+f x)^2 \tanh \left (\frac {c}{2}+\frac {i \pi }{4}+\frac {d x}{2}\right )}{a d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 3.76, size = 327, normalized size = 1.46 \begin {gather*} \frac {-2 d^2 e^2 \tanh ^{-1}\left (e^{c+d x}\right )+2 d^2 e f x \log \left (1-e^{c+d x}\right )+d^2 f^2 x^2 \log \left (1-e^{c+d x}\right )-2 d^2 e f x \log \left (1+e^{c+d x}\right )-d^2 f^2 x^2 \log \left (1+e^{c+d x}\right )-2 d f (e+f x) \text {PolyLog}\left (2,-e^{c+d x}\right )+\frac {2 f \left (d \left (-i d e^c x (2 e+f x)+2 \left (1+i e^c\right ) (e+f x) \log \left (1+i e^{c+d x}\right )\right )+2 \left (1+i e^c\right ) f \text {PolyLog}\left (2,-i e^{c+d x}\right )\right )}{-i+e^c}+2 d f (e+f x) \text {PolyLog}\left (2,e^{c+d x}\right )+2 f^2 \text {PolyLog}\left (3,-e^{c+d x}\right )-2 f^2 \text {PolyLog}\left (3,e^{c+d x}\right )-\frac {2 i d^2 (e+f x)^2 \sinh \left (\frac {d x}{2}\right )}{\left (\cosh \left (\frac {c}{2}\right )+i \sinh \left (\frac {c}{2}\right )\right ) \left (\cosh \left (\frac {1}{2} (c+d x)\right )+i \sinh \left (\frac {1}{2} (c+d x)\right )\right )}}{a d^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 572 vs. \(2 (204 ) = 408\).
time = 3.06, size = 573, normalized size = 2.56
method | result | size |
risch | \(-\frac {e^{2} \ln \left ({\mathrm e}^{d x +c}+1\right )}{a d}+\frac {e^{2} \ln \left ({\mathrm e}^{d x +c}-1\right )}{a d}+\frac {2 f^{2} \polylog \left (3, -{\mathrm e}^{d x +c}\right )}{a \,d^{3}}-\frac {2 f^{2} \polylog \left (3, {\mathrm e}^{d x +c}\right )}{a \,d^{3}}+\frac {4 i f^{2} \ln \left (1+i {\mathrm e}^{d x +c}\right ) x}{a \,d^{2}}+\frac {4 i f^{2} c \ln \left ({\mathrm e}^{d x +c}\right )}{a \,d^{3}}+\frac {4 i f^{2} \ln \left (1+i {\mathrm e}^{d x +c}\right ) c}{a \,d^{3}}-\frac {2 i f^{2} x^{2}}{a d}-\frac {2 e f \polylog \left (2, -{\mathrm e}^{d x +c}\right )}{a \,d^{2}}+\frac {2 e f \polylog \left (2, {\mathrm e}^{d x +c}\right )}{a \,d^{2}}-\frac {4 i f^{2} c \ln \left ({\mathrm e}^{d x +c}-i\right )}{a \,d^{3}}-\frac {4 i f^{2} c x}{a \,d^{2}}-\frac {2 e f c \ln \left ({\mathrm e}^{d x +c}-1\right )}{a \,d^{2}}+\frac {2 \ln \left (1-{\mathrm e}^{d x +c}\right ) c e f}{a \,d^{2}}+\frac {4 i f^{2} \polylog \left (2, -i {\mathrm e}^{d x +c}\right )}{a \,d^{3}}+\frac {2 f^{2} \polylog \left (2, {\mathrm e}^{d x +c}\right ) x}{a \,d^{2}}-\frac {2 \ln \left ({\mathrm e}^{d x +c}+1\right ) e f x}{a d}+\frac {2 \ln \left (1-{\mathrm e}^{d x +c}\right ) e f x}{a d}-\frac {4 i e f \ln \left ({\mathrm e}^{d x +c}\right )}{a \,d^{2}}+\frac {4 i e f \ln \left ({\mathrm e}^{d x +c}-i\right )}{a \,d^{2}}-\frac {2 f^{2} \polylog \left (2, -{\mathrm e}^{d x +c}\right ) x}{a \,d^{2}}-\frac {2 i f^{2} c^{2}}{a \,d^{3}}+\frac {f^{2} c^{2} \ln \left ({\mathrm e}^{d x +c}-1\right )}{a \,d^{3}}-\frac {f^{2} \ln \left ({\mathrm e}^{d x +c}+1\right ) x^{2}}{a d}+\frac {f^{2} \ln \left (1-{\mathrm e}^{d x +c}\right ) x^{2}}{a d}-\frac {f^{2} \ln \left (1-{\mathrm e}^{d x +c}\right ) c^{2}}{a \,d^{3}}+\frac {2 x^{2} f^{2}+4 e f x +2 e^{2}}{d a \left ({\mathrm e}^{d x +c}-i\right )}\) | \(573\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.43, size = 351, normalized size = 1.57 \begin {gather*} -\frac {2 i \, f^{2} x^{2}}{a d} - {\left (\frac {\log \left (e^{\left (-d x - c\right )} + 1\right )}{a d} - \frac {\log \left (e^{\left (-d x - c\right )} - 1\right )}{a d} - \frac {2}{{\left (a e^{\left (-d x - c\right )} + i \, a\right )} d}\right )} e^{2} - \frac {4 i \, f x e}{a d} + \frac {2 \, {\left (f^{2} x^{2} + 2 \, f x e\right )}}{a d e^{\left (d x + c\right )} - i \, a d} - \frac {2 \, {\left (d x \log \left (e^{\left (d x + c\right )} + 1\right ) + {\rm Li}_2\left (-e^{\left (d x + c\right )}\right )\right )} f e}{a d^{2}} + \frac {2 \, {\left (d x \log \left (-e^{\left (d x + c\right )} + 1\right ) + {\rm Li}_2\left (e^{\left (d x + c\right )}\right )\right )} f e}{a d^{2}} + \frac {4 i \, f e \log \left (i \, e^{\left (d x + c\right )} + 1\right )}{a d^{2}} - \frac {{\left (d^{2} x^{2} \log \left (e^{\left (d x + c\right )} + 1\right ) + 2 \, d x {\rm Li}_2\left (-e^{\left (d x + c\right )}\right ) - 2 \, {\rm Li}_{3}(-e^{\left (d x + c\right )})\right )} f^{2}}{a d^{3}} + \frac {{\left (d^{2} x^{2} \log \left (-e^{\left (d x + c\right )} + 1\right ) + 2 \, d x {\rm Li}_2\left (e^{\left (d x + c\right )}\right ) - 2 \, {\rm Li}_{3}(e^{\left (d x + c\right )})\right )} f^{2}}{a d^{3}} + \frac {4 i \, {\left (d x \log \left (i \, e^{\left (d x + c\right )} + 1\right ) + {\rm Li}_2\left (-i \, e^{\left (d x + c\right )}\right )\right )} f^{2}}{a d^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 571 vs. \(2 (200) = 400\).
time = 0.49, size = 571, normalized size = 2.55 \begin {gather*} \frac {2 \, c^{2} f^{2} - 4 \, c d f e + 2 \, d^{2} e^{2} - 4 \, {\left (-i \, f^{2} e^{\left (d x + c\right )} - f^{2}\right )} {\rm Li}_2\left (-i \, e^{\left (d x + c\right )}\right ) - 2 \, {\left (-i \, d f^{2} x - i \, d f e + {\left (d f^{2} x + d f e\right )} e^{\left (d x + c\right )}\right )} {\rm Li}_2\left (-e^{\left (d x + c\right )}\right ) - 2 \, {\left (i \, d f^{2} x + i \, d f e - {\left (d f^{2} x + d f e\right )} e^{\left (d x + c\right )}\right )} {\rm Li}_2\left (e^{\left (d x + c\right )}\right ) - 2 \, {\left (i \, d^{2} f^{2} x^{2} - i \, c^{2} f^{2} + 2 \, {\left (i \, d^{2} f x + i \, c d f\right )} e\right )} e^{\left (d x + c\right )} + {\left (i \, d^{2} f^{2} x^{2} + 2 i \, d^{2} f x e + i \, d^{2} e^{2} - {\left (d^{2} f^{2} x^{2} + 2 \, d^{2} f x e + d^{2} e^{2}\right )} e^{\left (d x + c\right )}\right )} \log \left (e^{\left (d x + c\right )} + 1\right ) - 4 \, {\left (c f^{2} - d f e + {\left (i \, c f^{2} - i \, d f e\right )} e^{\left (d x + c\right )}\right )} \log \left (e^{\left (d x + c\right )} - i\right ) + {\left (-i \, c^{2} f^{2} + 2 i \, c d f e - i \, d^{2} e^{2} + {\left (c^{2} f^{2} - 2 \, c d f e + d^{2} e^{2}\right )} e^{\left (d x + c\right )}\right )} \log \left (e^{\left (d x + c\right )} - 1\right ) + 4 \, {\left (d f^{2} x + c f^{2} - {\left (-i \, d f^{2} x - i \, c f^{2}\right )} e^{\left (d x + c\right )}\right )} \log \left (i \, e^{\left (d x + c\right )} + 1\right ) + {\left (-i \, d^{2} f^{2} x^{2} + i \, c^{2} f^{2} - 2 \, {\left (i \, d^{2} f x + i \, c d f\right )} e + {\left (d^{2} f^{2} x^{2} - c^{2} f^{2} + 2 \, {\left (d^{2} f x + c d f\right )} e\right )} e^{\left (d x + c\right )}\right )} \log \left (-e^{\left (d x + c\right )} + 1\right ) + 2 \, {\left (f^{2} e^{\left (d x + c\right )} - i \, f^{2}\right )} {\rm polylog}\left (3, -e^{\left (d x + c\right )}\right ) - 2 \, {\left (f^{2} e^{\left (d x + c\right )} - i \, f^{2}\right )} {\rm polylog}\left (3, e^{\left (d x + c\right )}\right )}{a d^{3} e^{\left (d x + c\right )} - i \, a d^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - \frac {i \left (\int \frac {e^{2} \operatorname {csch}{\left (c + d x \right )}}{\sinh {\left (c + d x \right )} - i}\, dx + \int \frac {f^{2} x^{2} \operatorname {csch}{\left (c + d x \right )}}{\sinh {\left (c + d x \right )} - i}\, dx + \int \frac {2 e f x \operatorname {csch}{\left (c + d x \right )}}{\sinh {\left (c + d x \right )} - i}\, dx\right )}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {{\left (e+f\,x\right )}^2}{\mathrm {sinh}\left (c+d\,x\right )\,\left (a+a\,\mathrm {sinh}\left (c+d\,x\right )\,1{}\mathrm {i}\right )} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________